import request from '../utils/request';

// 创建交易
export const createTransaction = (data) => {
  return request.post('/transactions', data);
};

// 获取交易列表
export const getTransactions = (params) => {
  return request.get('/transactions', { params });
};

// 获取单条交易
export const getTransactionById = (id) => {
  return request.get(`/transactions/${id}`);
};

// 获取用户交易记录
export const getUserTransactions = (userId, params) => {
  return request.get(`/transactions/user/${userId}`, { params });
};
